<!DOCTYPE html>

<html>
    <head>
        <title>#{get 'title' /}</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/main.css'}">
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/jquery_tools/form.css'}">
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/jquery_tools/columns.css'}">
        #{get 'moreStyles' /}
        <link rel="shortcut icon" type="image/png" href="@{'/public/images/favicon.png'}">
        <script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
        *{<script src="@{'/public/javascripts/jquery-1.4.2.min.js'}" type="text/javascript" charset="utf-8"></script>}*
        #{get 'moreScripts' /}
        <script>
			// Regular Expression to test whether the value is valid
			$.tools.validator.fn("[type=time]", "Please supply a valid time", function(input, value) { 
				return /^\d\d:\d\d$/.test(value);
			});
			 
			$.tools.validator.fn("[data-equals]", "Value not equal with the $1 field", function(input) {
				var name = input.attr("data-equals"),
				field = this.getInputs().filter("[name=" + name + "]");
				return input.val() == field.val() ? true : [name]; 
			});
			 
			$.tools.validator.fn("[minlength]","Please provide at least $1 character",function(input, value) {
				var min = input.attr("minlength");
				return value.length >= min ? true : [min];
			});
			$.tools.validator.localize("cn", {
				'*'			: '请更正',
				':email'  	: '请输入有效的电子邮箱地址',
				':number' 	: '请输入一个数值',
				':url' 		: '请输入有效的网址',
				'[max]'	 	: '请输入小于 $1的数值',
				'[min]'		: '请输入大于 $1的数值',
				'[required]'	: '请填写',
				'[data-equals]'	: '两次输入必须相同',
				'[type=time]'	: '请输入有效的时间',
				'[minlength]'	: '长度至少为$1'
			});
		</script>
    </head>

    <body>
        #{doLayout /}
    </body>
</html>
